/**
 *构建配置
 */
var mongoose  = require('mongoose');
var BaseModel = require("./base_model");
var Schema    = mongoose.Schema;

var BuildConfigSchema = new Schema({

    name:{
      type:String
    },

    title:{
      type:String
    },

    project:{
      type:Schema.Types.ObjectId, ref:'Project'
    },

    product_configs:[{type:Schema.Types.ObjectId, ref:'ProductConfig'}],

    type:{
      type: String,
      required: true // map to product config type
    },

    extend_info:{
      type: Schema.Types.Mixed //mk构建中可用于记录工作空间地址及状态
    },

    create_at: { type: Date, default: Date.now },

    update_at: { type: Date, default: Date.now }
});
BuildConfigSchema.plugin(BaseModel);
module.exports = mongoose.model('BuildConfig', BuildConfigSchema);
